package com.hp.utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtils {
    public static Date String4Date(String dateSource,String pattern){
        SimpleDateFormat sdf=new SimpleDateFormat(pattern);
        try {
            return sdf.parse(dateSource);
        } catch (ParseException e) {
            throw new RuntimeException(e);
        }
    }
}
